package org.rambadger.command.command;

import org.axonframework.commandhandling.annotation.TargetAggregateIdentifier;
import org.rambadger.command.validation.UrlIdentifier;

import javax.validation.constraints.NotNull;

public abstract class DeleteUploadedFile {
    public static class DeleteSubmissionFile extends DeleteUploadedFile {
        //Compound Key {
        @TargetAggregateIdentifier
        final String username;
        final int submissionId;
        //}
        final String filename;

        public DeleteSubmissionFile(String username, int submissionId, String filename) {
            this.username = username;
            this.submissionId = submissionId;
            this.filename = filename;
        }

        public String getUsername() {
            return username;
        }

        public int getSubmissionId() {
            return submissionId;
        }

        public String getFilename() {
            return filename;
        }
    }

    public static class DeleteAssignmentFile extends DeleteUploadedFile {
        //Compound Key {
        @TargetAggregateIdentifier
        final String platformId;
        final String assignmentId;
        //}
        final String filename;

        public DeleteAssignmentFile(String platformId, String assignmentId, String filename) {
            this.platformId = platformId;
            this.assignmentId = assignmentId;
            this.filename = filename;
        }

        public String getPlatformId() {
            return platformId;
        }

        public String getAssignmentId() {
            return assignmentId;
        }

        public String getFilename() {
            return filename;
        }
    }

    public static class RemoveUserPortrait extends DeleteUploadedFile {
        @TargetAggregateIdentifier
        final String username;

        public RemoveUserPortrait(String username) {
            this.username = username;
        }

        @UrlIdentifier @NotNull
        public String getUsername() {
            return username;
        }
    }
}
